package com.chenyilei.demo.controller;

import com.chenyilei.demo.mysql_dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import tk.mybatis.mapper.util.StringUtil;

import java.util.Map;

/**
 * 测试controller ,用于走通流程
 *
 * @author chenyilei
 * @date 2019/01/19- 15:55
 */
@Controller
public class DemoController {

    @Autowired
    UserMapper userMapper;

    @RequestMapping("/test1")
    public ModelAndView test1(Map map){
        map.put("id",userMapper.selectAll().get(0).getUserId());
        map.put("name",userMapper.selectAll().get(0).getUserName());
        map.put("obj",userMapper.selectAll().get(0));
        return new ModelAndView("test/thy1",map);
    }
    @RequestMapping("/vueTest")
    public ModelAndView test(Map map){
        return new ModelAndView("test/vue_01",map);
    }
}
